package com.ayq.activiti.manager.feign;

import com.ayq.activiti.common.util.Ret;
import com.ayq.activiti.manager.dto.ApprovalecordDTO;
import com.ayq.activiti.manager.dto.CheckActivitiEndDTO;
import com.ayq.activiti.manager.dto.WorkFlowApplyListDTO;
import com.ayq.activiti.manager.dto.WorkFlowOpinionDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "流程服务")
@RestController
@FeignClient(value = "activiti-manager", path = "/work-flow")
public interface WorkFlowFeignClient {


    @PostMapping("/startWorkFlow")
    @ApiOperation(value = "启动流程", notes = "启动流程")
    Ret startWorkFlow(WorkFlowOpinionDTO workFlowOpinionDTO);

    @GetMapping("/getUserTaskList")
    @ApiOperation(value = "获取用户审核列表", notes = "获取用户审核列表")
    Ret<List<WorkFlowApplyListDTO>> getUserTaskList(WorkFlowOpinionDTO workFlowOpinionDTO);

    @PostMapping("/agreeApprovalProcess")
    @ApiOperation(value = "同意审批流程", notes = "同意审批流程")
    Ret<WorkFlowApplyListDTO> agreeApprovalProcess(WorkFlowOpinionDTO workFlowOpinionDTO);

    @GetMapping("/getUserApplyList")
    @ApiOperation(value = "获取用户申请列表", notes = "获取用户申请列表")
    Ret<List<WorkFlowApplyListDTO>> getUserApplyList(WorkFlowOpinionDTO workFlowOpinionDTO);

    @PostMapping("/refuseApprovalProcess")
    @ApiOperation(value = "拒绝审批流程", notes = "拒绝审批流程")
    Ret refuseApprovalProcess(WorkFlowOpinionDTO workFlowOpinionDTO);

    @GetMapping("/getTaskOpinionList")
    @ApiOperation(value = "获取业务历史审核意见", notes = "获取业务历史审核意见")
    Ret<List<ApprovalecordDTO>> getTaskOpinionList(WorkFlowOpinionDTO workFlowOpinionDTO);

    @GetMapping("/checkActivitiEnd")
    @ApiOperation(value = "校验是否有流程在运行中", notes = "校验是否有流程在运行中")
    Ret<CheckActivitiEndDTO> checkActivitiEnd(CheckActivitiEndDTO checkActivitiEndDTO);

}
